#include "msq.hpp"

struct msgbuf{
	long mtype;
	char mtext[10];
};

int main()
{
	msgbuf buf;
	int msqid = Createmsgmid();
	int ret = msgsnd(msqid,&buf,sizeof(buf.mtext),IPC_NOWAIT);
	if(ret == -1) {
		log(Fatal,"msgget error:%s",strerror(errno));
		exit(3);
	}

	// struct msqid_ds ds;
	// int n = msgctl(msqid,IPC_STAT,&ds);

	int n = msgctl(msqid,IPC_RMID,NULL);

	return 0;
}